package com.huawei.appmarket.framework;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
import com.huawei.appgallery.foundation.account.bean.UserSession;
import com.huawei.appgallery.foundation.application.pkgmanage.model.update.ApkUpgradeInfo;
import com.huawei.appgallery.foundation.card.base.bean.KeywordInfo;
import com.huawei.appgallery.foundation.ui.framework.activity.AbstractBaseActivity;
import com.huawei.appgallery.foundation.ui.framework.activity.BaseActivity;
import com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment;
import com.huawei.appgallery.serverreqkit.api.bean.ResponseBean;
import com.huawei.appgallery.serverreqkit.api.bean.startup.StartupResponse;
import com.huawei.appgallery.serverreqkit.api.bean.startup.StartupResponse.TabInfo;
import com.huawei.appmarket.framework.startevents.bean.DistStartupResponse;
import com.huawei.appmarket.framework.startevents.control.SkinResourceCache;
import com.huawei.appmarket.framework.startevents.control.TabIconCache;
import com.huawei.appmarket.framework.widget.ColumnNavigator;
import com.huawei.appmarket.service.alarm.control.RepeatingTaskManager;
import com.huawei.appmarket.support.audio.notification.AudioNotificationJumpActivity;
import com.huawei.appmarket.support.widget.tabhost.FragmentTabHost;
import com.huawei.hms.framework.network.restclient.hianalytics.HianalyticsData;
import huawei.widget.HwBottomNavigationView;
import java.io.File;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import o.UserRationRectCache;
import o.HwDisplayRegionUtils;
import o.azc;
import o.bqs;
import o.bvn;
import o.cdb;
import o.cdf;
import o.cdg;
import o.cdj;
import o.cdx;
import o.cee;
import o.cfw;
import o.chp;
import o.cia;
import o.cir;
import o.ciy;
import o.cjo;
import o.cju;
import o.ckm;
import o.cku;
import o.cut;
import o.cvt;
import o.BaseRequest;
import o.cvv;
import o.HomePageAdapter;
import o.dgh;
import o.dgm;
import o.dgo;
import o.dgr;
import o.dgt;
import o.dgx;
import o.dgy;
import o.dhx;
import o.dhz;
import o.dic;
import o.dik;
import o.RoamDataManager;
import o.djk;
import o.djn;
import o.djo;
import o.djp;
import o.djq;
import o.dkk;
import o.dko;
import o.dmi;
import o.dmq;
import o.Logger;
import o.dof;
import o.dok;
import o.doo;
import o.ContentManager;
import o.dqn;
import o.dsi;
import o.dss;
import o.dug;
import o.dvp;
import o.dvt;
import o.dyf;
import o.ecb;
import o.eeg;
import o.eej;
import o.ehl;
import o.eod;
import o.epe;
import o.epr;
import o.CollectCheck;
import o.eqo;
import o.eqs;
import o.erg;
import o.erk;
import o.ese;
import o.est;
import o.etv;
import o.eua;
import o.euf;
import o.ActivityUtil;
import o.evf;
import o.evr;
import o.ewa;
import o.ewb;
import o.ewm.h;
import o.ewm.j;
import o.ewm.n;
import o.fho;
import o.fhq;
import o.fhz;
import o.SkinAttr;
import o.SkinnableView;
import o.fle;
import o.fln;
import o.flo;
import o.flr;
import o.flt;
import o.fmw;
import o.LayoutInflaterCompatHC;

public abstract class MainActivityBase<T extends cjo> extends BaseActivity<T> implements com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.BaseListFragment.c, com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment.e, huawei.widget.HwBottomNavigationView.e, fle, etv, fln, djo {
    protected String ʻॱ = "";
    protected HomePageAdapter mHomePagerAdapter;
    private String ʾ = null;
    private boolean ʿ = false;
    protected HwBottomNavigationView mBottomNavigationView;
    private Handler ˉ = new Handler();
    private List<StateListDrawable> stateListDrawables;
    private long ˊˋ = 0;
    private eej<Integer> ˊॱ = new eej();
    private eeg ˊᐝ = new eeg();
    private dhz ˋˊ;
    private bqs ˋˋ;
    protected FragmentTabHost tabHost;
    private List<SkinnableView> ˋᐝ = new ArrayList();
    private boolean ˌ = false;
    private flt ˍ;
    private boolean ˎˎ = false;
    private ViewGroup ˎˏ;
    private flo ˏˎ;
    private String ˏˏ = "";
    protected ImageView ˏॱ;
    private boolean ˑ = false;
    protected ColumnNavigator mColumnNavigator;
    private boolean ͺॱ = false;
    private boolean ـ = false;
    private boolean ॱʻ = false;
    private boolean ॱʼ = false;
    private boolean ॱʽ = false;
    protected o.dib.e ॱˊ;
    protected String ॱˋ = "";
    protected int mPagerPosition = -1;
    private boolean ॱͺ = false;
    private List<KeywordInfo> ᐝˊ = null;
    private int ᐝˋ = 0;
    protected int ᐝॱ = -1;
    private List<Drawable[]> menumIcons = new ArrayList();
    private djn ᐨ;

    public static class DummyTaskFragment extends TaskFragment {
    }

    static class a extends Handler {
        private WeakReference<MainActivityBase> ˊ;

        public a(MainActivityBase mainActivityBase) {
            this.ˊ = new WeakReference(mainActivityBase);
        }
    }

    class b implements Runnable {
        final /* synthetic */ MainActivityBase ˎ;

        private b(MainActivityBase mainActivityBase) {
            this.ˎ = mainActivityBase;
        }

        public void run() {
            this.ˎ.ॱʻ = false;
        }
    }

    static class c implements dhx {
        private WeakReference<MainActivityBase> ॱ;

        public c(MainActivityBase mainActivityBase) {
            this.ॱ = new WeakReference(mainActivityBase);
        }

        public void ॱ(boolean z, LinkedHashMap<Integer, boolean[]> linkedHashMap) {
            MainActivityBase mainActivityBase = (MainActivityBase) this.ॱ.get();
            if (mainActivityBase == null) {
                Logger.ˋ("MainActivityBase", "onTabIconGet mainActivityBase weakref null");
            } else if (z) {
                mainActivityBase.ˉ.post(new d(linkedHashMap, mainActivityBase));
            } else {
                Logger.e("MainActivityBase", "startGetTabIcon: download status failed");
            }
        }
    }

    static class d implements Runnable {
        private LinkedHashMap<Integer, boolean[]> ˋ;
        private WeakReference<MainActivityBase> weakref;

        public d(LinkedHashMap<Integer, boolean[]> linkedHashMap, MainActivityBase mainActivityBase) {
            this.weakref = new WeakReference(mainActivityBase);
            this.ˋ = linkedHashMap;
        }

        public void run() {
            MainActivityBase mainActivityBase = (MainActivityBase) this.weakref.get();
            if (mainActivityBase == null) {
                Logger.ˋ("MainActivityBase", "RefreshBottomTabRunnable mainActivityBase weakref null");
            } else {
                mainActivityBase.ˊ(this.ˋ);
            }
        }
    }

    class e implements ewa {
        final /* synthetic */ MainActivityBase ˊ;
        private CheckBox ˋ;

        public e(MainActivityBase mainActivityBase, CheckBox checkBox) {
            this.ˊ = mainActivityBase;
            this.ˋ = checkBox;
        }

        public void ˊ(Activity activity, DialogInterface dialogInterface) {
            Logger.ˎ("MainActivityBase", "showExitDialog cancel");
        }

        public void ˏ(Activity activity, DialogInterface dialogInterface, int i) {
            if (-1 == i) {
                Logger.ˎ("MainActivityBase", "showExitDialog BUTTON_POSITIVE");
                eua.ˏ().ˋ("CheckIfThereAreDownloadTask", this.ˋ.isChecked());
                this.ˊ.ॱʻ = true;
                this.ˊ.finish();
            }
        }
    }

    static class i extends o.dic.e {
        private WeakReference<MainActivityBase> ॱ;

        public i(MainActivityBase mainActivityBase) {
            super(mainActivityBase);
            this.ॱ = new WeakReference(mainActivityBase);
        }

        public void ˊ() {
            super.ˊ();
            MainActivityBase mainActivityBase = (MainActivityBase) this.ॱ.get();
            if (mainActivityBase != null) {
                mainActivityBase.ꜟ();
            }
        }

        public void ॱ() {
            super.ॱ();
            MainActivityBase mainActivityBase = (MainActivityBase) this.ॱ.get();
            if (mainActivityBase != null) {
                mainActivityBase.ʹ();
            }
        }
    }

    protected abstract void doubleExist();

    protected abstract boolean ˋ(TaskFragment taskFragment, StartupResponse startupResponse);

    public abstract void excuteStateOfLogin(StartupResponse startupResponse);

    protected abstract int ͺ();

    protected abstract void ॱ(TaskFragment taskFragment);

    public abstract TaskFragment ॱˊ();

    public abstract void ᐝ();

    public abstract int ᐝॱ();

    @SuppressLint({"NewApi"})
    public void onCreate(Bundle bundle) {
        requestWindowFeature(1);
        HwDisplayRegionUtils.configRoundCorner((Context) this);
        SkinResourceCache ˊ = dic.ˊ(dgm.ˎ((Activity) this));
        ˎ(bundle, ˊ);
        erg.ॱ().ˊ();
        if (!this.ˌ) {
            this.ˊˋ = System.currentTimeMillis();
        }
        djk.ˋ().ˎ(MainActivityBase.class);
        this.ˋˊ = new dhz(getApplicationContext());
        super.onCreate(bundle);
        if (bundle != null) {
            this.mPagerPosition = bundle.getInt("pagerindex", -1);
        }
        this.ʾ = this.ʻॱ;
        Logger.ˎ("MainActivityBase", "onCreate, entry home");
        ((cdf) cdb.ॱ(cdf.class)).ॱ();
        Object ab_ = ab_();
        ˋ(ab_);
        ᐝ();
        setRationRectPadding();
        if (this.ˏॱ != null) {
            if (evf.ˊ(this.ˏॱ)) {
                this.ˏॱ.setVisibility(0);
            } else {
                this.ˏॱ.setVisibility(8);
            }
        }
        this.ˎˏ = (ViewGroup) findViewById(16908290);
        if (ab_ == null) {
            final com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment.b ˏ = eqo.ॱ().ˏ(dgm.ˎ((Activity) this));
            if (ˏ == null || !doo.ˊ((Context) this)) {
                eqo.ॱ().ˊ(dgm.ˎ((Activity) this));
                ॱˊ().ˋ(ˏॱ(), ᐝॱ(), "LoadingFragment");
            } else {
                new Handler().post(new Runnable(this) {
                    final /* synthetic */ MainActivityBase ˊ;

                    public void run() {
                        Logger.ˎ("MainActivityBase", "startupData is not null");
                        this.ˊ.ˋ(new DummyTaskFragment(), ˏ);
                        eqo.ॱ().ˊ(dgm.ˎ(this.ˊ));
                    }
                });
            }
        } else {
            Fragment findFragmentByTag = ˏॱ().findFragmentByTag("LoadingFragment");
            if ((findFragmentByTag == null || findFragmentByTag.ˊᐝ()) && this.ॱˊ.ˊ() != null) {
                ॱ(this.ॱˊ.ˊ(), this.ॱˊ.ˋ());
                ᶥ();
                ᐨ();
                ˊᐝ();
            }
        }
        ˊ(bundle, ˊ);
        ᐝˋ();
        epe.ˏ().ˋ((BaseActivity) this, bundle);
        this.ᐝˊ = this.ॱˊ.ˏ();
        this.ᐨ = new djn(getTaskId());
        if (!CollectCheck.isEmpty(this.ᐝˊ)) {
            this.ᐨ.ˏ(this.ᐝˊ);
        }
        AudioNotificationJumpActivity.ˎ(this, getIntent());
    }

    private void setRationRectPadding() {
        Rect mRect = UserRationRectCache.ˏ().getRationRect();
        if (mRect != null && this.mBottomNavigationView != null && this.tabHost != null) {
            int i = mRect.left;
            int i2 = mRect.right;
            int i3 = mRect.bottom;
            this.mBottomNavigationView.setPaddingRelative(i, this.mBottomNavigationView.getPaddingTop(), i2, i3);
            this.tabHost.setPaddingRelative(i, this.tabHost.getPaddingTop(), i2, i3);
        }
    }

    public void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        AudioNotificationJumpActivity.ˎ(this, intent);
    }

    private void ˎ(Bundle bundle, SkinResourceCache skinResourceCache) {
        if (bundle == null || bundle.getBoolean("has_available_skinpath", true)) {
            this.ˏˏ = dic.ˏ(skinResourceCache);
        }
        if (!TextUtils.isEmpty(this.ˏˏ)) {
            this.ˎˎ = true;
            ehl.ˎ();
            ˎ(this.ˏˏ);
            this.ˍ = new flt(this);
            LayoutInflaterCompatHC.setLayoutInfaltorFactory2(getLayoutInflater(), this.ˍ);
        }
    }

    private void ˋ(Object obj) {
        if (obj == null) {
            this.ॱˊ = new o.dib.e();
            this.ॱˊ.ॱ(this.ˊॱ);
            return;
        }
        this.ॱˊ = (o.dib.e) obj;
        this.ˊॱ = this.ॱˊ.ॱ();
    }

    private void ᐝˋ() {
        if (this.ˎˎ) {
            ˊ(getWindow().getDecorView(), "background", o.ewm.c.ॱˎ);
        }
    }

    private void ˊ(Bundle bundle, SkinResourceCache skinResourceCache) {
        if (bundle != null) {
            this.ͺॱ = bundle.getBoolean("has_started_particle_anim", false);
        }
        if ((bundle == null || bundle.getBoolean("particle_anim_enable", true)) && !TextUtils.isEmpty(dic.ॱ(skinResourceCache))) {
            this.ॱʼ = true;
            ˏ(this.ˎˏ, skinResourceCache);
        }
    }

    private void ॱ(List<ckm> list, int i) {
        this.mColumnNavigator.addColumn(list);
    }

    protected void wrapperNavigator(HwBottomNavigationView hwBottomNavigationView) {
        this.mColumnNavigator = new ColumnNavigator(this, hwBottomNavigationView);
    }

    public Object T_() {
        this.ॱˊ.ॱ(this.ˊॱ);
        this.ॱˊ.ˊ(this.mColumnNavigator.getColumn());
        return this.ॱˊ;
    }

    protected void initTabHost() {
        if (this.mHomePagerAdapter == null) {
            this.mHomePagerAdapter = new HomePageAdapter(this.mColumnNavigator.getColumn());
            this.tabHost.setup(this, ˏॱ(), ͺ());
            this.tabHost.setForbidTabDestroyed(true);
            this.tabHost.setAdapter(this.mHomePagerAdapter);
            this.tabHost.setOnTabSelectedListener(this.mColumnNavigator);
        }
    }

    @SuppressLint({"NewApi"})
    protected void ˊᐝ() {
        if (this.mHomePagerAdapter == null) {
            initTabHost();
            if (this.mPagerPosition != -1) {
                this.tabHost.setCurrentTab(this.mPagerPosition);
                this.mBottomNavigationView.setItemChecked(this.mPagerPosition);
            } else if (this.ᐝॱ > 0 && this.ᐝॱ < this.mColumnNavigator.getColumnCount()) {
                this.tabHost.setCurrentTab(this.ᐝॱ);
                this.mBottomNavigationView.setItemChecked(this.ᐝॱ);
            }
        }
    }

    public cia ॱ(int i) {
        return this.ˊॱ.ˋ(Integer.valueOf(i));
    }

    public void ˋ(int i, cia o_cia) {
        this.ˊॱ.ˏ(Integer.valueOf(i), o_cia);
    }

    public void onDestroy() {
        Logger.ˎ("MainActivityBase", "finish onDestroy()");
        ese.ˎ();
        dgh.ˏ();
        dvp.ˊ().ˋ();
        ecb ॱ = ecb.ॱ();
        if (ॱ != null && ॱ.ˏ() == this) {
            ॱ.cancel(true);
            ecb.ˋ(null);
        }
        evr.ˊ().ˋॱ();
        ᐝˊ();
        dgy.ˊ();
        flr.ˋ((Context) this).ˎ((fln) this);
        ॱͺ();
        super.onDestroy();
    }

    private void ᐝˊ() {
        int columnCount = this.mColumnNavigator.getColumnCount();
        for (int i = 0; i < columnCount; i++) {
            ckm o_ckm = (ckm) this.mColumnNavigator.getColumn().get(i);
            if (cju.ˏ(o_ckm.ˊ())) {
                this.mColumnNavigator.unregisterBroadCastCustomTabItem(o_ckm.ᐝ());
            }
        }
    }

    public void ˎ(TaskFragment taskFragment, List<cvt> list) {
        cvv ˎ = cvv.ˎ();
        if (ˎ.versionCode_ == epr.ˎ().ˋ()) {
            ˎ.setRequestType(BaseRequest.RequestStrategy.REQUEST_CACHE);
        } else {
            ˎ.setRequestType(BaseRequest.RequestStrategy.REQUEST_NETWORK_REF_CACHE);
        }
        ˎ.setCacheExpiredTime(168);
        ˎ.setCacheID(ˎ.getCacheID() + dgm.ˎ((Activity) this));
        ˎ.setServiceType_(dgm.ˎ((Activity) this));
        list.add(ˎ);
    }

    @SuppressLint({"NewApi"})
    public boolean ˋ(TaskFragment taskFragment, com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment.b bVar) {
        StartupResponse startupResponse = (StartupResponse) bVar.ˋ;
        if (startupResponse.getResponseCode() == 0 && startupResponse.getRtnCode_() == 0) {
            if (startupResponse.getResponseType() != com.huawei.appgallery.serverreqkit.api.bean.ResponseBean.a.FROM_CACHE) {
                if (1 != startupResponse.ˊ()) {
                    this.ॱʻ = true;
                    ˎ(startupResponse, ((cvv) bVar.ˊ).getServiceType_());
                    finish();
                    return false;
                }
                ʼ(startupResponse);
                ˋ(startupResponse);
                startupResponse.ˎ(bVar.ˊ);
            }
            ॱ(taskFragment, startupResponse);
            ॱ(taskFragment);
            euf.ˎ().ˋ(startupResponse.ˋॱ());
            if (startupResponse.getResponseType() != com.huawei.appgallery.serverreqkit.api.bean.ResponseBean.a.FROM_CACHE) {
                cvv o_cvv = (cvv) bVar.ˊ;
                if (o_cvv.versionCode_ != epr.ˎ().ˋ()) {
                    epr.ˎ().ॱ(o_cvv.versionCode_);
                }
                if (startupResponse instanceof DistStartupResponse) {
                    RoamDataManager.build().ˎ(((DistStartupResponse) startupResponse).ʿ());
                }
                dvt.ˏ().ॱ();
                ﾞ();
                dug.ˊ((Context) this);
                dsi.ˏ(new AsyncTask(this) {
                    final /* synthetic */ MainActivityBase ˎ;

                    {
                        this.ˎ = r1;
                    }

                    protected Object doInBackground(Object[] objArr) {
                        ˋ();
                        Logger.ˎ("MainActivityBase", "check upgrade return,start check Client OTA Update");
                        dmq.ॱ.ˊ(new dmi(this) {
                            final /* synthetic */ AnonymousClass1 ˎ;

                            {
                                this.ˎ = r1;
                            }

                            public void run() {
                                if (ActivityUtil.isAcitivtyNotValid(this.ˎ.ˎ)) {
                                    Logger.ˎ("MainActivityBase", "activity have finished.do not check ota update.");
                                } else if (!ecb.ˎ(this.ˎ.ˎ, new o.ecb.e(this) {
                                    final /* synthetic */ AnonymousClass5 ˊ;

                                    {
                                        this.ˊ = r1;
                                    }

                                    public void ˏ(ApkUpgradeInfo apkUpgradeInfo) {
                                        if (apkUpgradeInfo.ˋᐝ() == 1) {
                                            this.ˊ.ˎ.ˎ.ˎ(true);
                                            dvt.ˏ().ˋ(1);
                                            AbstractBaseActivity.sendUpgrade(this.ˊ.ˎ.ˎ);
                                            Logger.ˎ("MainActivityBase", "doCloseApp end");
                                        }
                                    }
                                })) {
                                    this.ˎ.ˎ.ˉ();
                                }
                            }
                        });
                        return null;
                    }

                    private void ˋ() {
                        if (((cdg) cdb.ॱ(cdg.class)).ˊ(true, 1) > 0 && dss.ॱ().ˎ()) {
                            Bundle bundle = new Bundle();
                            bundle.putInt(RepeatingTaskManager.KEY_PRE_DOWNLOAD_START_TYPE, 4);
                            RepeatingTaskManager.execute(ContentManager.getInstant().getContext(), bundle, dqn.class);
                            Logger.ˎ("MainActivityBase", "ENTER MAINACTIVITY finds update apps,Start PreDlManagerTask immediately.");
                        }
                    }
                });
                ˍ();
                ˎˎ();
            }
            if (dgr.ˋ().ॱ()) {
                cvt o_dgt = new dgt(dgr.ˋ().ˎ());
                o_dgt.setServiceType_(dgr.ˋ().ˏ());
                cfw.ˎ(o_dgt, new dgo("MainActivityBase"));
            }
            dvp.ˊ().ˎ(ContentManager.getInstant().getContext());
            dvp.ˊ().ॱ(ContentManager.getInstant().getContext(), true);
            return ˎ(startupResponse);
        }
        ˊ(taskFragment, startupResponse);
        return false;
    }

    protected int ˎ(ResponseBean responseBean) {
        int responseCode = responseBean.getResponseCode();
        if (responseCode != 0 || responseBean.getRtnCode_() == 0) {
            return responseCode;
        }
        return 1;
    }

    public void ˍ() {
        this.ˋˊ.ˋ(dgm.ˎ((Activity) this));
    }

    public void ˎˎ() {
        if (!dok.ᐝ(this) && doo.ॱॱ(this) && !doo.ᐝ(this)) {
            this.ˋˊ.ˎ(dgm.ˎ((Activity) this));
        }
    }

    private void ˋ(StartupResponse startupResponse) {
        if (startupResponse instanceof DistStartupResponse) {
            ˎ((Context) this, ((DistStartupResponse) startupResponse).ॱˋ());
        }
    }

    private void ˎ(Context context, String str) {
        String ॱ = eua.ˏ().ॱ("physical_address", "");
        if (dof.ˋ(ॱ) || !ॱ.equals(str)) {
            dko o_dko = new dko();
            o_dko.ˏ(20161007);
            dkk.ˊ(ContentManager.getInstant().getContext(), o_dko).ॱ();
        }
    }

    protected void ˉ() {
    }

    private void ॱ(TaskFragment taskFragment, StartupResponse startupResponse) {
        if (startupResponse.getResponseType() != com.huawei.appgallery.serverreqkit.api.bean.ResponseBean.a.UPDATE_CACHE) {
            if (startupResponse.ᐝ() != null) {
                ˊ(startupResponse);
                ᶥ();
                ᐨ();
            }
            ˏ(false);
            taskFragment.ॱ(ˏॱ());
            ˊᐝ();
            excuteStateOfLogin(startupResponse);
        }
        ॱ(startupResponse);
    }

    private void ᐨ() {
        this.ˋˊ.ˏ(this.mColumnNavigator.getColumn(), dgm.ˎ((Activity) this), new c(this));
    }

    private boolean ˎ(StartupResponse startupResponse) {
        if (startupResponse.getResponseType() == com.huawei.appgallery.serverreqkit.api.bean.ResponseBean.a.FROM_CACHE || 1 != startupResponse.ˊॱ() || UserSession.getInstance().isLoginSuccessful()) {
            return true;
        }
        forceLogin();
        return false;
    }

    protected void forceLogin() {
    }

    protected String ˌ() {
        return "searchbox";
    }

    private void ˊ(StartupResponse startupResponse) {
        int size = startupResponse.ᐝ().size();
        this.mColumnNavigator.clearNavi();
        int i = 0;
        for (int i2 = 0; i2 < size; i2++) {
            TabInfo tabInfo = (TabInfo) startupResponse.ᐝ().get(i2);
            ckm o_ckm = new ckm();
            o_ckm.ॱ(tabInfo.ᐝ());
            o_ckm.ˎ(tabInfo.ʼ());
            o_ckm.ˋ(tabInfo.ͺ());
            o_ckm.ˏ(tabInfo.ʽ());
            o_ckm.ˏ(tabInfo.ॱ());
            o_ckm.ˊ(tabInfo.ˋ());
            o_ckm.ˎ(tabInfo.ˊॱ());
            o_ckm.ʽ(ˌ());
            if (dof.ˋ(this.ॱˋ)) {
                if (!dof.ˋ(this.ʻॱ) && this.ʻॱ.equals(tabInfo.ʼ())) {
                    this.ᐝॱ = i;
                }
            } else if (this.ॱˋ.equals(tabInfo.ͺ())) {
                this.ᐝॱ = i;
            }
            this.mColumnNavigator.addColumn(o_ckm, startupResponse.ᐝ().size());
            i++;
            dss.ॱ().ˋ(tabInfo.ʼ(), o_ckm);
        }
        this.ॱˊ.ˊ(this.mColumnNavigator.getColumn());
    }

    private void ᶥ() {
        int i = 6;
        if (this.mColumnNavigator.getColumnCount() <= 6) {
            i = this.mColumnNavigator.getColumnCount();
        }
        this.mBottomNavigationView.setBottomNavListener(this);
        this.mBottomNavigationView.ˎ();
        ˎ(i);
        if (this.ˏˎ != null) {
            ㆍ();
        }
        if (this.ᐝॱ <= 0 || this.ᐝॱ >= this.mColumnNavigator.getColumnCount()) {
            this.mBottomNavigationView.setItemChecked(this.mPagerPosition == -1 ? 0 : this.mPagerPosition);
        } else {
            this.mBottomNavigationView.setItemChecked(this.ᐝॱ);
        }
        ˏ(i);
    }

    private void ˏ(int i) {
        for (int i2 = 0; i2 < i; i2++) {
            ckm o_ckm = (ckm) this.mColumnNavigator.getColumn().get(i2);
            if (cju.ˏ(o_ckm.ˊ())) {
                this.mBottomNavigationView.ˏ(i2, o_ckm.ʼ());
            }
        }
    }

    private void ˎ(int i) {
        this.stateListDrawables = ʼ(i);
        if (this.stateListDrawables.size() == i) {
            ˊ(i, this.stateListDrawables);
        } else {
            ᐝ(i);
        }
    }

    private void ˊ(int i, List<StateListDrawable> list) {
        for (int i2 = 0; i2 < i; i2++) {
            this.mBottomNavigationView.ˏ(((ckm) this.mColumnNavigator.getColumn().get(i2)).ˋ(), (Drawable) list.get(i2));
        }
    }

    private void ᐝ(int i) {
        Drawable ˋˋ = ˋˋ();
        for (int i2 = 0; i2 < i; i2++) {
            this.mBottomNavigationView.ˏ(((ckm) this.mColumnNavigator.getColumn().get(i2)).ˋ(), ˋˋ);
        }
    }

    protected Drawable ˋˋ() {
        return getResources().getDrawable(o.ewm.e.ʼˊ);
    }

    protected List<Drawable[]> getMenuIcons() {
        if (!CollectCheck.isEmpty(this.menumIcons)) {
            return this.menumIcons;
        }
        this.menumIcons.add(new Drawable[]{(Drawable) fmw.ˏ(this, o.ewm.e.ˋʽ, "drawable"), (Drawable) fmw.ˏ(this, o.ewm.e.ˋʻ, "drawable")});
        this.menumIcons.add(new Drawable[]{(Drawable) fmw.ˏ(this, o.ewm.e.ʽˊ, "drawable"), (Drawable) fmw.ˏ(this, o.ewm.e.ʾॱ, "drawable")});
        this.menumIcons.add(new Drawable[]{(Drawable) fmw.ˏ(this, o.ewm.e.ˊʼ, "drawable"), (Drawable) fmw.ˏ(this, o.ewm.e.ˈॱ, "drawable")});
        this.menumIcons.add(new Drawable[]{(Drawable) fmw.ˏ(this, o.ewm.e.ʽᐝ, "drawable"), (Drawable) fmw.ˏ(this, o.ewm.e.ˊʻ, "drawable")});
        this.menumIcons.add(new Drawable[]{(Drawable) fmw.ˏ(this, o.ewm.e.ʿॱ, "drawable"), (Drawable) fmw.ˏ(this, o.ewm.e.ˉॱ, "drawable")});
        this.menumIcons.add(new Drawable[]{(Drawable) fmw.ˏ(this, o.ewm.e.ʼᐝ, "drawable"), (Drawable) fmw.ˏ(this, o.ewm.e.ʽˋ, "drawable")});
        if (this.ˏˎ != null) {
            return this.menumIcons;
        }
        List<Drawable[]> arrayList = new ArrayList(this.menumIcons);
        this.menumIcons.clear();
        return arrayList;
    }

    private List<StateListDrawable> ʼ(int i) {
        List<StateListDrawable> arrayList = new ArrayList();
        for (int i2 = 0; i2 < i; i2++) {
            StateListDrawable ʻ = ʻ(i2);
            if (ʻ != null) {
                arrayList.add(ʻ);
            }
        }
        return arrayList;
    }

    private StateListDrawable ʻ(int i) {
        TabIconCache ॱ = dik.ॱ(dgm.ˎ((Activity) this), i);
        if (ॱ == null) {
            return null;
        }
        return getTabIconSelector(ॱ.ॱ(), ॱ.ˊ());
    }

    private StateListDrawable getTabIconSelector(String str, String str2) {
        if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) {
            Logger.e("MainActivityBase", "tabIconNormalCache=" + str + ", tabIconClickedCache=" + str2);
            return null;
        }
        File file = new File(str);
        File file2 = new File(str2);
        if (!file.exists() || !file2.exists()) {
            Logger.e("MainActivityBase", "file is not exist");
            return null;
        } else if (0 == file.length() || 0 == file2.length()) {
            Logger.e("MainActivityBase", "file length is 0.");
            return null;
        } else {
            try {
                Bitmap decodeFile = BitmapFactory.decodeFile(str2);
                Bitmap decodeFile2 = BitmapFactory.decodeFile(str);
                StateListDrawable stateListDrawable = new StateListDrawable();
                stateListDrawable.addState(new int[]{16842913}, new BitmapDrawable(decodeFile));
                stateListDrawable.addState(new int[0], new BitmapDrawable(decodeFile2));
                return stateListDrawable;
            } catch (OutOfMemoryError e) {
                Logger.e("MainActivityBase", "getTabIconSelector() ");
                return null;
            }
        }
    }

    public void ˊ(MenuItem menuItem, int i) {
        Fragment ॱ = this.tabHost.ॱ();
        if (ॱ != null && (ॱ instanceof ciy)) {
            ((ciy) ॱ).ʾॱ();
        }
    }

    public void ˏ(MenuItem menuItem, int i) {
        this.tabHost.setCurrentTab(i);
        this.ᐝˋ = i;
        String ˊ = ((ckm) this.mColumnNavigator.getColumn().get(i)).ˊ();
        String ˋ = ((ckm) this.mColumnNavigator.getColumn().get(i)).ˋ();
        this.ʾ = ˊ;
        if (this.ʿ) {
            ʼ();
        }
        reportBottomTabClick(ˊ, ˋ);
        this.mColumnNavigator.reportOper(i);
        if (this.ˏˎ != null) {
            Drawable[] drawableArr = (Drawable[]) getMenuIcons().get(i);
            this.mBottomNavigationView.setActiveColor(evf.ॱ((Context) this, o.ewm.c.ᐝ));
            this.mBottomNavigationView.ॱ(((ckm) this.mColumnNavigator.getColumn().get(i)).ˋ(), drawableArr[1], i, false);
        }
    }

    public String ʿ() {
        return this.ʾ;
    }

    private void reportBottomTabClick(String str, String str2) {
        int ˎ = dgm.ˎ((Activity) this);
        if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) {
            Logger.e("MainActivityBase", "reportBottomTabClick, tabName = " + str2 + ", tabId = " + str);
            return;
        }
        chp.ˋ(new o.chr.e().ˊ(str).ˎ(str2).ˏ(String.valueOf(ˎ)).ˎ());
        Logger.ˎ("MainActivityBase", "reportBottomTabClick, tabName = " + str2 + ", tabId: " + str + ", serviceType: " + ˎ);
    }

    public void ˎ(MenuItem menuItem, int i) {
        if (this.ʿ) {
            S_();
        }
        if (this.ˏˎ != null) {
            this.mBottomNavigationView.ॱ(((ckm) this.mColumnNavigator.getColumn().get(i)).ˋ(), ((Drawable[]) getMenuIcons().get(i))[0], i, false);
        }
    }

    private void ˊ(TaskFragment taskFragment, StartupResponse startupResponse) {
        if (!ˋ(taskFragment, startupResponse) && taskFragment != null) {
            cir o_cir = (cir) taskFragment.ˊ(cir.class);
            if (o_cir != null) {
                o_cir.ॱ(ˎ((ResponseBean) startupResponse), true);
            }
        }
    }

    private void ꓸ() {
        View inflate = getLayoutInflater().inflate(h.ॱꓸ, null);
        LinearLayout linearLayout = (LinearLayout) inflate.findViewById(j.ㆍᐝ);
        int ˎ = ewb.ˎ(this);
        linearLayout.setPadding(ˎ, 0, ˎ, 0);
        CheckBox checkBox = (CheckBox) inflate.findViewById(j.ᶫ);
        checkBox.setText(n.ʿˋ);
        ((TextView) inflate.findViewById(j.ꞌᐝ)).setText(n.ˉˋ);
        ImageView imageView = (ImageView) inflate.findViewById(j.ˋꞋ);
        if (azc.ˎ().ॱ() >= 17) {
            imageView.setVisibility(8);
        }
        cku ˏ = cku.ˏ(this, cku.class, getResources().getString(n.ˊ), null);
        ˏ.ˊ(inflate);
        ˏ.ˎ(-3, 8);
        ˏ.ˋ(new e(this, checkBox));
        ˏ.ˎ((Context) this);
    }

    private void ꜞ() {
        boolean z = (1 == dgm.ˎ((Activity) this) || this.ॱʻ || ॱˋ()) ? false : true;
        if (z) {
            z = dvt.ˏ().ʽ();
            Logger.ˎ("finish", "finish " + getClass().getSimpleName() + ", appcenter id:" + dgm.ˎ() + ",gamecenter id:" + dgm.ˊ());
            boolean ˏ = eua.ˏ().ˏ("CheckIfThereAreDownloadTask", false);
            if (!z || ˏ || dgm.ˋ(dgm.ˎ((Activity) this))) {
                doubleExist();
                this.ॱʻ = true;
                new Handler().postDelayed(new b(), 2000);
                return;
            } else if (!isFinishing()) {
                ꓸ();
                return;
            } else {
                return;
            }
        }
        ˎ(false);
    }

    public void finish() {
        if (Thread.currentThread() == Looper.getMainLooper().getThread()) {
            ꜞ();
        } else {
            runOnUiThread(new Runnable(this) {
                final /* synthetic */ MainActivityBase ˋ;

                {
                    this.ˋ = r1;
                }

                public void run() {
                    this.ˋ.ꜞ();
                }
            });
        }
    }

    public void ˎ(boolean z) {
        this.ͺॱ = false;
        this.ˑ = true;
        djp.ˎ().ˋ(false);
        djp.ˎ().ˏ(false);
        djp.ˎ().ᐝ(false);
        est.ॱॱ();
        ese.ˎ();
        dgh.ˏ();
        cvt o_dgt = new dgt("back_pressed");
        o_dgt.setServiceType_(dgm.ˎ((Activity) this));
        cfw.ˎ(o_dgt, new dgo("MainActivityBase"));
        new dyf().ˊ(dgm.ˎ((Activity) this));
        erk.ˎ().ˊ();
        ˏˏ();
        eqs.ˎ().ॱ();
        erg.ॱ().ˋ();
        cvt.setApsid_(System.currentTimeMillis());
        epe.ˏ().ˏ((BaseActivity) this);
        eod.ˋ();
        super.finish();
    }

    protected void ˏˏ() {
        if (ॱˋ()) {
            cfw.ˋ();
        }
        djq.ˏ().ˊ();
        ˎˏ();
        dkk.ˏ();
        dgr.ˋ().ˊ();
        fhq ˏ = fho.ˏ();
        ((cut) ˏ.ˋ("RealName").ॱ(cut.class)).ˎ();
        ((bvn) ˏ.ˋ("Message").ॱ(bvn.class)).ˋ();
        evr.ˊ().ͺ();
    }

    protected void ˎˏ() {
        UserSession.getInstance().reset();
    }

    public void onResume() {
        ˏ(false);
        this.ʿ = true;
        super.onResume();
        dvp.ˊ().ॱ(ContentManager.getInstant().getContext(), true);
        if (this.ˎˎ) {
            flr.ˋ((Context) this).ॱ((fln) this);
            if (this.ˏˎ != null) {
                flr.ˋ((Context) this).ˎ(this.ˏˎ);
            }
        }
        if (this.ॱʽ && this.ॱʼ) {
            ˏ(this.ˎˏ, dic.ˊ(dgm.ˎ((Activity) this)));
        }
        this.ॱʽ = false;
        if (this.ᐨ != null) {
            this.ᐨ.ˎ();
        }
    }

    public void onPause() {
        this.ʿ = false;
        this.ॱʽ = true;
        super.onPause();
        ͺॱ();
        if (this.ᐨ != null) {
            this.ᐨ.ˊ();
        }
    }

    public void ˏ(boolean z) {
        this.ॱͺ = z;
    }

    public void onSaveInstanceState(Bundle bundle) {
        if (this.tabHost != null) {
            bundle.putInt("pagerindex", this.tabHost.getCurrentTab());
        }
        super.onSaveInstanceState(bundle);
        ˏ(true);
        bundle.putBoolean("has_available_skinpath", this.ˎˎ);
        bundle.putBoolean("particle_anim_enable", this.ॱʼ);
        bundle.putBoolean("has_started_particle_anim", this.ͺॱ);
    }

    protected void ˎ(StartupResponse startupResponse, int i) {
    }

    public void ˊ(boolean z) {
        this.ॱʻ = z;
    }

    private void ˊ(LinkedHashMap<Integer, boolean[]> linkedHashMap) {
        int columnCount = this.mColumnNavigator.getColumnCount() > 6 ? 6 : this.mColumnNavigator.getColumnCount();
        if (linkedHashMap != null && linkedHashMap.size() >= columnCount) {
            for (int i = 0; i < columnCount; i++) {
                boolean[] zArr = (boolean[]) linkedHashMap.get(Integer.valueOf(i));
                if (zArr[0] && zArr[1]) {
                    ʽ(i);
                }
            }
        }
    }

    private void ʽ(int i) {
        if (!this.ـ && this.ˏˎ == null) {
            Drawable ʻ = ʻ(i);
            if (ʻ != null) {
                this.mBottomNavigationView.ॱ(((ckm) this.mColumnNavigator.getColumn().get(i)).ˋ(), ʻ, i, true);
            }
        }
    }

    private void ㆍ() {
        int columnCount = this.mColumnNavigator.getColumnCount() > 6 ? 6 : this.mColumnNavigator.getColumnCount();
        List ˋᐝ = getMenuIcons();
        if (ˋᐝ.size() >= columnCount) {
            for (int i = 0; i < columnCount; i++) {
                Drawable[] drawableArr = (Drawable[]) ˋᐝ.get(i);
                if (this.ᐝˋ == i) {
                    this.mBottomNavigationView.ॱ(((ckm) this.mColumnNavigator.getColumn().get(i)).ˋ(), drawableArr[1], i, false);
                } else {
                    this.mBottomNavigationView.ॱ(((ckm) this.mColumnNavigator.getColumn().get(i)).ˋ(), drawableArr[0], i, false);
                }
                this.mBottomNavigationView.setDefaultColor(evf.ॱ((Context) this, o.ewm.c.ॱˊ));
                this.mBottomNavigationView.setActiveColor(evf.ॱ((Context) this, o.ewm.c.ᐝ));
            }
        }
    }

    protected void ˏˎ() {
        if (!this.ˌ) {
            this.ˊˋ = System.currentTimeMillis() - this.ˊˋ;
            String concat = cdj.ˏ().concat("026");
            LinkedHashMap linkedHashMap = new LinkedHashMap();
            linkedHashMap.put(HianalyticsData.ERROR_CODE, "time_0001_".concat(this.ˊˋ + ""));
            ese.ˋ(concat, linkedHashMap);
            this.ˌ = true;
        }
    }

    private void ʼ(StartupResponse startupResponse) {
        List ᐝ = startupResponse.ᐝ();
        if (!CollectCheck.isEmpty(ᐝ)) {
            TabInfo tabInfo = (TabInfo) ᐝ.get(0);
            if (tabInfo != null) {
                Object ʼ = tabInfo.ʼ();
                if (!TextUtils.isEmpty(ʼ)) {
                    dgx.ˏ().ॱ(ʼ);
                }
            }
        }
    }

    protected void ˏ(final ViewGroup viewGroup, SkinResourceCache skinResourceCache) {
        if (viewGroup != null && !this.ͺॱ && skinResourceCache != null) {
            final Object ॱ = dic.ॱ(skinResourceCache);
            if (TextUtils.isEmpty(ॱ)) {
                Logger.ˋ("MainActivityBase", "particle resource path is null");
                return;
            }
            final int ᐝ = skinResourceCache.ᐝ();
            if (ᐝ == 0 || skinResourceCache.ʽ() == 0) {
                Logger.e("MainActivityBase", "particle param not invalide!");
            } else {
                new a(this).postDelayed(new Runnable(this) {
                    final /* synthetic */ MainActivityBase ˎ;

                    public void run() {
                        this.ˎ.ˏ(ॱ, viewGroup, ᐝ);
                    }
                }, 3000);
            }
        }
    }

    protected void ͺॱ() {
        if (this.ˋˋ != null) {
            this.ˋˋ.ˊ();
            this.ˋˋ = null;
        }
    }

    protected void ˏ(String str, ViewGroup viewGroup, int i) {
        if (!this.ॱʽ && !this.ͺॱ) {
            fhq ˏ = fho.ˏ();
            if (ˏ != null) {
                fhz ˋ = ˏ.ˋ("FestivalAnimation");
                if (ˋ != null) {
                    this.ͺॱ = true;
                    this.ˋˋ = (bqs) ˋ.ॱ(bqs.class);
                    this.ˋˋ.ॱ(str);
                    this.ˋˋ.ˎ(viewGroup, i);
                    new a(this).postDelayed(new Runnable(this) {
                        final /* synthetic */ MainActivityBase ˎ;

                        {
                            this.ˎ = r1;
                        }

                        public void run() {
                            this.ˎ.ͺॱ();
                        }
                    }, 13000);
                }
            }
        }
    }

    public void ˑ() {
        ॱʽ();
    }

    public void ˊ(View view, String str, int i) {
        if (this.ˎˎ && this.ˍ != null) {
            this.ˍ.ˊ(this, view, str, i);
        }
    }

    public SkinnableView ˋ(SkinnableView o_fkw) {
        if (!this.ˎˎ) {
            return new SkinnableView();
        }
        if (!flr.ˋ((Context) this).ˋ()) {
            int indexOf = this.ˋᐝ.indexOf(o_fkw);
            if (indexOf >= 0) {
                SkinnableView o_fkw2 = (SkinnableView) this.ˋᐝ.get(indexOf);
                List ˏ = o_fkw2.ˏ();
                if (ˏ == null) {
                    return o_fkw2;
                }
                for (SkinAttr o_fko : o_fkw.ˏ()) {
                    int indexOf2 = ˏ.indexOf(o_fko);
                    if (indexOf2 >= 0) {
                        ˏ.set(indexOf2, o_fko);
                    } else {
                        ˏ.add(o_fko);
                    }
                }
                return o_fkw2;
            }
            this.ˋᐝ.add(o_fkw);
        }
        return o_fkw;
    }

    public void ॱʽ() {
        if (!CollectCheck.isEmpty(this.ˋᐝ)) {
            for (SkinnableView o_fkw : this.ˋᐝ) {
                if (o_fkw.ˋ() != null) {
                    o_fkw.ˎ(false);
                }
            }
            this.ˋᐝ.clear();
        }
    }

    public void ॱͺ() {
        if (!CollectCheck.isEmpty(this.ˋᐝ)) {
            for (SkinnableView ॱ : this.ˋᐝ) {
                ॱ.ॱ();
            }
        }
    }

    public boolean ॱʼ() {
        return this.ˎˎ;
    }

    public void ـ() {
    }

    public djn ॱʻ() {
        return this.ᐨ;
    }

    public void ˎ(String str) {
        dic.ˎ().ˎ(str, this.ˏˎ, new i(this));
    }

    private void ꜟ() {
        this.ˎˎ = false;
        flr.ˋ((Context) this).ˎ(null);
        this.ˋᐝ.clear();
    }

    private void ʹ() {
        if (Logger.ˎ()) {
            Logger.ˏ("MainActivityBase", "set Skin success");
        }
        if (this.mBottomNavigationView != null) {
            this.ـ = true;
            ㆍ();
        }
        ﹳ();
    }

    private void ﹳ() {
        flo ˊ = flr.ˋ((Context) this).ˊ();
        if (ˊ != null && ˊ != this.ˏˎ && dic.ˎ().ॱ(this.ˏˏ)) {
            this.ˏˎ = ˊ;
        }
    }

    protected void ॱ(StartupResponse startupResponse) {
        this.ᐝˊ = startupResponse == null ? null : startupResponse.ʽ();
        if (!CollectCheck.isEmpty(this.ᐝˊ)) {
            if (this.ॱˊ != null) {
                this.ॱˊ.ˋ(this.ᐝˊ);
            }
            if (this.ᐨ != null) {
                this.ᐨ.ˏ(this.ᐝˊ);
            }
        }
    }

    public boolean ᐧ() {
        return this.ˑ;
    }

    private void ﾞ() {
        cdx.ˊ(new Runnable(this) {
            final /* synthetic */ MainActivityBase ˏ;

            {
                this.ˏ = r1;
            }

            public void run() {
                cee.ˎ();
            }
        });
    }
}
